//设置一个默认值

let response = {
    settings:{
        headerText:""
    }
}
//空字符串,默认值也会生效
const headerText = response.settings.headerText || 'Hello, world!';

console.info(headerText);

const txt = response.settings.headerText ?? 'Hello, world!';

console.info(txt);